object IfElseExercise01{
  def main(args: Array[String]): Unit = {
    test1(11,111)
    test2(111.0,11.0)
    test3(12,3)
    test4(-1000)
  }
  def test1(n1: Int,n2: Int): Unit = {
    if (n1 + n2 >= 50) {
      println("hello world!")
    }
  }
  def test2(d1: Double, d2: Double): Unit = {
    if (d1 > 10.0 && d2 < 20.0){
      println(d1 + d2)
    }
  }
  def  test3(n1: Int, n2: Int): Unit = {    var sum = n1 + n2
    if (sum % 3 ==0 && sum % 5 ==0){
      println(s"$n1+$n2 既能被3整除又能被5整除")
    }
  }
  def test4(year: Int): Unit = {
    if (year < 0) {
      if (year < 0) {
        println("请输入合理的年份")
      }else{
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
          println(s"$year 年是闰年")
        }
      }
    }
  }
}
